﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="corpinfoedit.aspx.cs" Inherits="LTJ.WebPage.SystemManage.corp.corpinfoedit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>企业信息编辑</title>
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <link href="../css/comm.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript" src="../js/common.js"></script>
    <script type="text/javascript">
        function validate(theform) {
            if (form1.cname.value == "") {
                resetPage();
                alert("请填写公司名称，公司名称不能为空！");
                form1.cname.focus();
                return false;
            }
            if (form1.ecname.value == "") {
                resetPage();
                alert("请填写公司英文名称，公司英文名称不能为空！");
                form1.ecname.focus();
                return false;
            }
            return true;
        }
        function resetPage() {
            document.getElementById('success').style.display = 'none';
            document.getElementById("editcorp").disabled = false;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server" enctype="multipart/form-data">
    <div class="adnr">
    <fieldset>
                <legend id="opt" style="background: url(../images/icons/icon53.jpg) no-repeat 6px 50%;">
                    公司信息维护</legend>
                <table cellspacing="0" cellpadding="4" class="adtb" width="80%">
                    <tr>
                        <td width="25%"><p class="zi1">公司名称:</p>
                            <input type="hidden" id="cid" name="cid" value="<%=cid%>" />
                            <input type="hidden" id="opmode" name="opmode" value="<%=opmode%>" />
                        </td>
                        <td>
                            <p class="zi2"><input value="<%=cinfo.cname%>" id="cname" name="cname" type="text" maxlength="100" size="30" class="soout" onfocus="this.className='soon';" onblur="this.className='soout';" /></p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="zi1">英文名称:</p>
                        </td>
                        <td>
                            <p class="zi2"><input value="<%=cinfo.ecname%>" id="ecname" name="ecname" type="text" maxlength="100" size="30" class="soout" onfocus="this.className='soon';" onblur="this.className='soout';" /></p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="zi1">用户限制:</p>
                        </td>
                        <td>
                            <p class="zi2">
                            管理员数量<input value="<%=cinfo.mcount%>" id="managercount" name="managercount" type="text" maxlength="8" size="8" class="soout" onfocus="this.className='soon';" onblur="this.className='soout';" />
                            会员数量<input value="<%=cinfo.ucount%>" id="usercount" name="usercount" type="text" maxlength="8" size="8" class="soout" onfocus="this.className='soon';" onblur="this.className='soout';" />
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td><p class="zi1">企业积分:</p></td>
                        <td><p class="zi2"><input type="text" class="soout" onfocus="this.className='soon';" onblur="this.className='soout';" id="corp_score" name="corp_score" maxlength="6" size="8" value="<%=cinfo.Scores%>"/></p></td>
                    </tr>
                    <tr>
                        <td>
                            <p class="zi1">主营业务:</p>
                        </td>
                        <td>
                            <p class="zi2">
                            <%
                                LTJ.Entity.MainEnum menum = new LTJ.Entity.MainEnum();
                                foreach (string mname in Enum.GetNames(menum.GetType()))
                                {
                                    int s_value = Convert.ToInt16(Enum.Parse(menum.GetType(), mname));
                                    string s_text = LTJ.Entity.EnumType.GetMainEnumType(s_value);
                            %>
                            <input name="mainstr" value="<%=s_value%>" type="checkbox" <%=(","+cinfo.Mains+",").Contains("," + s_value + ",")?"checked":""%>/><%=s_text%>
                            <%
                                }
                            %>
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="zi1">联 系 人:</p>
                        </td>
                        <td>
                            <p class="zi2"><input value="<%=cinfo.relater%>" id="relater" name="relater" type="text" maxlength="100" size="10" class="soout" onfocus="this.className='soon';" onblur="this.className='soout';" /></p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="zi1">联系电话:</p>
                        </td>
                        <td>
                            <p class="zi2"><input value="<%=cinfo.Phone%>" id="phone" name="phone" type="text" maxlength="20" size="10" class="soout" onfocus="this.className='soon';" onblur="this.className='soout';" /></p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="zi1">电子邮箱:</p>
                        </td>
                        <td>
                            <p class="zi2"><input value="<%=cinfo.Email%>" id="email" name="email" type="text" maxlength="50" size="20" class="soout" onfocus="this.className='soon';" onblur="this.className='soout';" /></p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="zi1">公司网址:</p>
                        </td>
                        <td>
                            <p class="zi2"><input value="<%=cinfo.WebUrl%>" id="weburl" name="weburl" type="text" maxlength="50" size="20" class="soout" onfocus="this.className='soon';" onblur="this.className='soout';" /></p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="zi1">MSN:</p>
                        </td>
                        <td>
                            <p class="zi2"><input value="<%=cinfo.MSN%>" id="msn" name="msn" type="text" maxlength="50" size="20" class="soout" onfocus="this.className='soon';" onblur="this.className='soout';" /></p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="zi1">其他联系方式:</p>
                        </td>
                        <td>
                            <p class="zi2"><textarea id="relateform" name="relateform" style="width:220px;height:50px" class="soout" onfocus="this.className='soon';" onblur="this.className='soout';"><%=cinfo.relateform%></textarea></p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="zi1">公司简介:</p>
                        </td>
                        <td>
                            <p class="zi2"><textarea id="bio" name="bio" style="width:300px;height:80px" class="soout" onfocus="this.className='soon';" onblur="this.className='soout';"><%=cinfo.bio%></textarea></p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="zi1">公司Logo:</p>
                        </td>
                        <td>
                            <p class="zi2" id="qylogo"><input type="file" id="clogo" onchange="PhotoView()" name="clogo"/></p>
                        </td>
                    </tr>
                    <%if(opmode=="edit"){%>
                    <tr>
                        <td>
                            <p class="zi1">Logo图例:</p>
                        </td>
                        <td>
                            <p class="zi2" id="P1"><img src="<%=cinfo.logo%>" /></p>
                        </td>
                    </tr>
                    <%}%>
                </table>
                <p class="insa">
		            <span><input class="save" id="editcorp" name="" type="submit" value="确 定" onclick="return validate(this.form);"/></span>
                    <span><input class="save" name="" type="button" value="取 消" onclick="parent.Lightview.hide();"/></span>
	            </p>
            </fieldset>
    </div>
    </form>
</body>
<script type="text/javascript">
    function PhotoView() {
        var file = document.getElementById("clogo").value;
        if (file != "") {
            var patn = /\.jpg$|\.jpeg$|\.gif$|\.png$/i;
            if (!patn.test(file)) {
                clearFileInput(document.getElementById("clogo"));
                alert("相册只允许jpg、jpeg、gif或png格式的图片!");
                return;
            }
        }
    }

    function clearFileInput(file) {
        var form = document.createElement('form');
        document.body.appendChild(form);
        form.appendChild(file);
        form.reset();
        document.getElementById("qylogo").appendChild(file);
        document.body.removeChild(form);
    }
</script>
</html>
